package com.ssm.design.state;

import com.ssm.design.state.impl.CreateOrderState;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

@ComponentScan("com.ssm.design.state")
public class OrderClient {

    public static void main(String[] args) {
        AnnotationConfigApplicationContext applicationContext =
                new AnnotationConfigApplicationContext(OrderClient.class);
        OrderStateFactory factory = applicationContext.getBean(OrderStateFactory.class);
        factory.switchState(1);
    }
}